package com.jilujia.domain.region.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jilujia.domain.region.Region;
import com.jilujia.domain.region.repository.RegionRepository;
import com.jilujia.framework.domain.AbstractService;

@Service("regionService")
@Transactional(readOnly = true)
public class RegionServiceImpl extends AbstractService implements RegionService {

	@Autowired
	private RegionRepository regionRepository;

	public List<Region> findAllRegions() {
		List<Region> regions = regionRepository.findAll();
		return regions;
	}

	public Region findRegionById(Long regionId) {
		Region region = regionRepository.findOne(regionId);
		return region;
	}
}
